<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <script src="/res/js/sweetalert.min.js"></script>

    <script src="/res/js/jquery.min.js"></script>

    <script>
        $(function(){
            $("#login_btn").on("click",function (){

                let url = "/user/login.action"; //登录的url地址
                /*var data = {
                    userName:$("#userName").val()
                }*/
                let data = $("#myform").serialize();

                $.post(url,data,function (resp){
                    if(resp.state==1){
                        swal("成功")
                    }else{
                        swal("失败")
                    }
                },"json");
            })
        })
    </script>
</head>
<body>
    欢迎登陆!您的SpringMVC环境搭建成功!
    <form id="myform">
        <p>用户名:<input type="text" name="userName"></p>
        <p>密码:<input type="password" name="userPwd"></p>
        <p><input type="button" value="登录" id="login_btn"></p>
    </form>
</body>
</html>